 import {mapGetters} from 'vuex'
export default {
  computed: {
    ...mapGetters('m_cart',['total'])
  },
  onShow() {
    this.setBege()
  },
  methods: {
    setBege(a) {
      uni.setTabBarBadge({
        index:2,
        text:a || this.total + ''
      })
    }
  },
  watch: {
    total(newValue) {
      let n = newValue + ''
      this.setBege(n)
    }
  }
}